﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using FinApp.Commands.Base;

namespace FinApp.Commands {
    public class LoginCommand : CommandBase {

        #region Members
        private string userName;
        private string userPassword;
        #endregion

        #region Constructors
        /// <summary>
        /// Inicializa una nueva instancia de la clase <see cref="LoginCommand"/>.
        /// </summary>
        /// <param name="action">La acción.</param>
        public LoginCommand(Action action) : base(action, false) {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Command"/> class.
        /// </summary>
        /// <param name="parameterizedAction">The parameterized action.</param>
        /// <param name="canExecute">if set to <c>true</c> [can execute].</param>
        public LoginCommand(Action<object> parameterizedAction)
            : base(parameterizedAction, false) {
        }
        #endregion

        #region Property Overrides
        protected override bool CanExecuteCommand {
            get {
                return true;
                return (!string.IsNullOrWhiteSpace(this.userName) && !string.IsNullOrWhiteSpace(this.userPassword));
            }
            set {
                base.CanExecuteCommand = value;
            }
        }
        #endregion

        #region Methods
        public void SetUserName(string userName) {
            this.userName = userName;
        }

        public void SetUserPassword(string userPassword) {
            this.userPassword = userPassword;
        }
        #endregion

    }
}
